package com.busi.wms.model;

import java.util.Map;

import com.jfinal.plugin.activerecord.Model;
import com.zcurd.common.tool.DbMetaTool;

public class WmsOutstorage extends Model<WmsOutstorage> {
	private static final long serialVersionUID = 1L;
	public static final WmsOutstorage me = new WmsOutstorage();
		
	public Map<String, Object> getDictDataout_type() {
		return DbMetaTool.getDictData("select '1' 'key', '使用消耗' 'text' union all select '2', '退货'");
	}	
		
	public Map<String, Object> getDictDatastorage_no() {
		return DbMetaTool.getDictData("select cast(id as varchar) 'key',storage_name 'text' from [cquni-wms].dbo.wms_storage");
	}	
		
	public Map<String, Object> getDictDataoperate_type() {
		return DbMetaTool.getDictData("select '1' 'key', '人工' 'text' union all select '2', '自动'");
	}

	public Map<String, Object> getDictDataout_status() {
		return DbMetaTool.getDictData("select dict_key, dict_value from sys_dict where dict_type='单据类型'");
	}

	public Map<String, Object> getYears() {
		return DbMetaTool.getDictData("select distinct convert(char(4),out_time,112) as 'key' , convert(char(4),out_time,112) as 'text' from [cquni-wms].dbo.wms_outstorage");
	}
	public Map<String, Object> getMonths() {
		return DbMetaTool.getDictData("select distinct convert(char(2),out_time,110) as 'key' , convert(char(2),out_time,110) as 'text' from [cquni-wms].dbo.wms_outstorage");
	}
	
}
